home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / QD3DRenderer.p < prev    next >
Encoding:
Text File  |  1998-02-12  |  42.8 KB  |  1,256 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DRenderer.p
  3.  
  4.      Contains:    Q3Renderer types and routines                                          
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT QD3DRenderer;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __QD3DRENDERER__}
  28. {$SETC __QD3DRENDERER__ := 1}
  29.  
  30. {$I+}
  31. {$SETC QD3DRendererIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __QD3D__}
  35. {$I QD3D.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __QD3DSET__}
  38. {$I QD3DSet.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __QD3DVIEW__}
  41. {$I QD3DView.p}
  42. {$ENDC}
  43.  
  44. {$IFC TARGET_OS_MAC }
  45. {$IFC UNDEFINED __EVENTS__}
  46. {$I Events.p}
  47. {$ENDC}
  48. {$ENDC}  {TARGET_OS_MAC}
  49.  
  50.  
  51. {$PUSH}
  52. {$ALIGN POWER}
  53. {$LibExport+}
  54.  
  55. {*****************************************************************************
  56.  **                                                                             **
  57.  **                            User Interface Things                             **
  58.  **                                                                             **
  59.  ****************************************************************************}
  60. {$IFC TARGET_OS_MAC }
  61. {
  62.  *  A callback to an application's event handling code. This is needed to    
  63.  *  support movable modal dialogs. The dialog's event filter calls this      
  64.  *  callback with events it does not handle.                                 
  65.  *  If an application handles the event it should return kQ3True.            
  66.  *  If the application does not handle the event it must return kQ3False and 
  67.  *  the dialog's event filter will pass the event to the system unhandled.   
  68.  }
  69.  
  70. TYPE
  71. {$IFC TYPED_FUNCTION_POINTERS}
  72.     TQ3MacOSDialogEventHandler = FUNCTION({CONST}VAR event: EventRecord): TQ3Boolean; C;
  73. {$ELSEC}
  74.     TQ3MacOSDialogEventHandler = ProcPtr;
  75. {$ENDC}
  76.  
  77.     TQ3DialogAnchorPtr = ^TQ3DialogAnchor;
  78.     TQ3DialogAnchor = RECORD
  79.         clientEventHandler:        TQ3MacOSDialogEventHandler;
  80.     END;
  81.  
  82. {$ENDC}  {TARGET_OS_MAC}
  83.  
  84. {$IFC TARGET_OS_WIN32 }
  85.  
  86. TYPE
  87.     TQ3DialogAnchor = RECORD
  88.         ownerWindow:            HWND;
  89.     END;
  90.  
  91. {$ENDC}  {TARGET_OS_WIN32}
  92.  
  93. {$IFC TARGET_OS_UNIX }
  94.  
  95. TYPE
  96.     TQ3DialogAnchorPtr = ^TQ3DialogAnchor;
  97.     TQ3DialogAnchor = RECORD
  98.         notUsed:                Ptr;                                    {  place holder  }
  99.     END;
  100.  
  101. {$ENDC}  {TARGET_OS_UNIX}
  102.  
  103. {*****************************************************************************
  104.  **                                                                             **
  105.  **                            Renderer Functions                                 **
  106.  **                                                                             **
  107.  ****************************************************************************}
  108. FUNCTION Q3Renderer_NewFromType(rendererObjectType: TQ3ObjectType): TQ3RendererObject; C;
  109. FUNCTION Q3Renderer_GetType(renderer: TQ3RendererObject): LONGINT; C;
  110.  
  111. { Q3Renderer_Flush has been replaced by Q3View_Flush }
  112. { Q3Renderer_Sync has been replaced by Q3View_Sync }
  113.  
  114. {
  115.  *    Q3Renderer_IsInteractive
  116.  *        Determine if this renderer is intended to be used interactively.
  117.  }
  118. FUNCTION Q3Renderer_IsInteractive(renderer: TQ3RendererObject): TQ3Boolean; C;
  119.  
  120. {
  121.  *    Q3Renderer_HasModalConfigure
  122.  *        Determine if this renderer has a modal settings dialog.
  123.  *
  124.  *    Q3Renderer_ModalConfigure
  125.  *        Have the renderer pop up a modal dialog box to configure its settings.
  126.  *    dialogAnchor - is platform specific data passed by the client to support
  127.  *      movable modal dialogs. 
  128.  *    MacOS: this is a callback to the calling application's event handler.
  129.  *      The renderer calls this function with events not handled by the 
  130.  *      settings dialog. This is necessary in order to support movable modal 
  131.  *      dialogs. An application's event handler must return kQ3True if it 
  132.  *      handles the event passed to the callback or kQ3False if not. 
  133.  *      An application which doesn't want to support a movable modal configure
  134.  *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  135.  *    Win32: this is the HWND of the owning window (typically an application's
  136.  *      main window).
  137.  *  canceled - returns a boolean inditacating that the user canceled the 
  138.  *    dialog.
  139.  *      
  140.  }
  141. FUNCTION Q3Renderer_HasModalConfigure(renderer: TQ3RendererObject): TQ3Boolean; C;
  142. FUNCTION Q3Renderer_ModalConfigure(renderer: TQ3RendererObject; dialogAnchor: TQ3DialogAnchor; VAR canceled: TQ3Boolean): TQ3Status; C;
  143. {
  144.  *    Q3RendererClass_GetNickNameString
  145.  *        Allows an application to get a renderers name string, the 
  146.  *        renderer is responsible for storing this in a localizable format
  147.  *        for example as a resource.  This string can then be used to provide
  148.  *        a selection mechanism for an application (for example in a menu).
  149.  *
  150.  *        If this call returns nil in the supplied string, then the App may 
  151.  *         choose to use the class name for the renderer.  You should always 
  152.  *        try to get the name string before using the class name, since the
  153.  *        class name is not localizable.
  154.  }
  155. FUNCTION Q3RendererClass_GetNickNameString(rendererClassType: TQ3ObjectType; VAR rendererClassString: TQ3ObjectClassNameString): TQ3Status; C;
  156.  
  157. {
  158.  *    Q3Renderer_GetConfigurationData
  159.  *        Allows an application to collect private renderer configuration data
  160.  *      which it will then save. For example in a preference file or in a 
  161.  *        style template. An application should tag this data with the 
  162.  *        Renderer's object  name.
  163.  *    
  164.  *        if dataBuffer is NULL actualDataSize returns the required size in 
  165.  *        bytes of a data buffer large enough to store private data. 
  166.  *
  167.  *      bufferSize is the actual size of the memory block pointed to by 
  168.  *        dataBuffer
  169.  *
  170.  *        actualDataSize - on return the actual number of bytes written to the 
  171.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  172.  * 
  173.  }
  174. FUNCTION Q3Renderer_GetConfigurationData(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32; VAR actualDataSize: UInt32): TQ3Status; C;
  175. FUNCTION Q3Renderer_SetConfigurationData(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32): TQ3Status; C;
  176.  
  177.  
  178. {*****************************************************************************
  179.  **                                                                             **
  180.  **                        Interactive Renderer Specific Functions                 **
  181.  **                                                                             **
  182.  ****************************************************************************}
  183. { CSG IDs attribute }
  184. { Object IDs, to be applied as attributes on geometries }
  185.  
  186. CONST
  187.     kQ3AttributeTypeConstructiveSolidGeometryID = 'csgi';
  188.  
  189.     kQ3SolidGeometryObjNone        = -1;
  190.     kQ3SolidGeometryObjA        = 0;
  191.     kQ3SolidGeometryObjB        = 1;
  192.     kQ3SolidGeometryObjC        = 2;
  193.     kQ3SolidGeometryObjD        = 3;
  194.     kQ3SolidGeometryObjE        = 4;
  195.  
  196. { Possible CSG equations }
  197.  
  198. TYPE
  199.     TQ3CSGEquation                 = LONGINT;
  200. CONST
  201.     kQ3CSGEquationAandB            = {TQ3CSGEquation}$88888888;
  202.     kQ3CSGEquationAandnotB        = {TQ3CSGEquation}$22222222;
  203.     kQ3CSGEquationAanBonCad        = {TQ3CSGEquation}$2F222F22;
  204.     kQ3CSGEquationnotAandB        = {TQ3CSGEquation}$44444444;
  205.     kQ3CSGEquationnAaBorCanB    = {TQ3CSGEquation}$74747474;
  206.  
  207.  
  208. TYPE
  209.     TQ3HiddenSurfaceRemovalMode  = LONGINT;
  210. CONST
  211.     kQ3HiddenSurfaceRemovalMode_None = {TQ3HiddenSurfaceRemovalMode}0;
  212.     kQ3HiddenSurfaceRemovalMode_Shallow = {TQ3HiddenSurfaceRemovalMode}1;
  213.     kQ3HiddenSurfaceRemovalMode_Deep = {TQ3HiddenSurfaceRemovalMode}2;
  214.  
  215. FUNCTION Q3InteractiveRenderer_SetCSGEquation(renderer: TQ3RendererObject; equation: TQ3CSGEquation): TQ3Status; C;
  216. FUNCTION Q3InteractiveRenderer_GetCSGEquation(renderer: TQ3RendererObject; VAR equation: TQ3CSGEquation): TQ3Status; C;
  217. FUNCTION Q3InteractiveRenderer_SetPreferences(renderer: TQ3RendererObject; vendorID: LONGINT; engineID: LONGINT): TQ3Status; C;
  218. FUNCTION Q3InteractiveRenderer_GetPreferences(renderer: TQ3RendererObject; VAR vendorID: LONGINT; VAR engineID: LONGINT): TQ3Status; C;
  219. FUNCTION Q3InteractiveRenderer_SetDoubleBufferBypass(renderer: TQ3RendererObject; bypass: TQ3Boolean): TQ3Status; C;
  220. FUNCTION Q3InteractiveRenderer_GetDoubleBufferBypass(renderer: TQ3RendererObject; VAR bypass: TQ3Boolean): TQ3Status; C;
  221. FUNCTION Q3InteractiveRenderer_SetRAVEContextHints(renderer: TQ3RendererObject; RAVEContextHints: UInt32): TQ3Status; C;
  222. FUNCTION Q3InteractiveRenderer_GetRAVEContextHints(renderer: TQ3RendererObject; VAR RAVEContextHints: UInt32): TQ3Status; C;
  223. FUNCTION Q3InteractiveRenderer_SetRAVETextureFilter(renderer: TQ3RendererObject; RAVEtextureFilterValue: UInt32): TQ3Status; C;
  224. FUNCTION Q3InteractiveRenderer_GetRAVETextureFilter(renderer: TQ3RendererObject; VAR RAVEtextureFilterValue: UInt32): TQ3Status; C;
  225.  
  226. {*****************************************************************************
  227.  **                                                                             **
  228.  **                            Renderer View Tools                                 **
  229.  **                                                                             **
  230.  **                    You may only call these methods from a plug-in             **
  231.  **                                                                             **
  232.  ****************************************************************************}
  233. {
  234.  *    Call by a renderer to call the user "idle" method, with progress 
  235.  *    information.
  236.  *    
  237.  *    Pass in (view, 0, n) on first call
  238.  *    Pass in (view, 1..n-1, n) during rendering
  239.  *    Pass in (view, n, n) upon completion
  240.  *    
  241.  *    Note: The user must have supplied an idleProgress method with 
  242.  *    Q3XView_SetIdleProgressMethod. Otherwise, the generic idle method is
  243.  *    called with no progress data. e.g. the Q3View_SetIdleMethod method
  244.  *    is called instead. (current and final are ignored, essentially.)
  245.  *
  246.  *    Returns kQ3Failure if rendering is cancelled.
  247.  }
  248. FUNCTION Q3XView_IdleProgress(view: TQ3ViewObject; current: UInt32; completed: UInt32): TQ3Status; C;
  249. {
  250.  *    Called by an asynchronous renderer when it completes a frame.
  251.  }
  252. FUNCTION Q3XView_EndFrame(view: TQ3ViewObject): TQ3Status; C;
  253.  
  254. {*****************************************************************************
  255.  **                                                                             **
  256.  **                            Renderer AttributeSet Tools                         **
  257.  **                                                                             **
  258.  **                    You may only call these methods from a plug-in             **
  259.  **                                                                             **
  260.  ****************************************************************************}
  261. {
  262.  *    Faster access to geometry attribute sets.
  263.  *    
  264.  *    Returns pointer to INTERNAL data structure for elements and attributes
  265.  *    in an attributeSet, or NULL if no attribute exists.
  266.  *    
  267.  *    For attributes of type kQ3AttributeType..., the internal data structure
  268.  *    is identical to the data structure used in Q3AttributeSet_Add.
  269.  }
  270. FUNCTION Q3XAttributeSet_GetPointer(attributeSet: TQ3AttributeSet; attributeType: TQ3AttributeType): Ptr; C;
  271.  
  272.  
  273. CONST
  274.     kQ3XAttributeMaskNone        = 0;
  275.     kQ3XAttributeMaskSurfaceUV    = $01;
  276.     kQ3XAttributeMaskShadingUV    = $02;
  277.     kQ3XAttributeMaskNormal        = $04;
  278.     kQ3XAttributeMaskAmbientCoefficient = $08;
  279.     kQ3XAttributeMaskDiffuseColor = $10;
  280.     kQ3XAttributeMaskSpecularColor = $20;
  281.     kQ3XAttributeMaskSpecularControl = $40;
  282.     kQ3XAttributeMaskTransparencyColor = $80;
  283.     kQ3XAttributeMaskSurfaceTangent = $0100;
  284.     kQ3XAttributeMaskHighlightState = $0200;
  285.     kQ3XAttributeMaskSurfaceShader = $0400;
  286.     kQ3XAttributeMaskCustomAttribute = $80000000;
  287.     kQ3XAttributeMaskAll        = $800007FF;
  288.     kQ3XAttributeMaskInherited    = $03FF;
  289.     kQ3XAttributeMaskInterpolated = $01FF;
  290.  
  291.  
  292. TYPE
  293.     TQ3XAttributeMask                    = UInt32;
  294. FUNCTION Q3XAttributeSet_GetMask(attributeSet: TQ3AttributeSet): TQ3XAttributeMask; C;
  295.  
  296. {*****************************************************************************
  297.  **                                                                             **
  298.  **                            Renderer Draw Context Tools                         **
  299.  **                                                                             **
  300.  ****************************************************************************}
  301.  
  302. TYPE
  303.     TQ3XDrawRegion = ^LONGINT;
  304. FUNCTION Q3XDrawContext_GetDrawRegion(drawContext: TQ3DrawContextObject; VAR drawRegion: TQ3XDrawRegion): TQ3Status; C;
  305.  
  306. TYPE
  307.     TQ3XDrawContextValidationMasks  = LONGINT;
  308. CONST
  309.     kQ3XDrawContextValidationClearFlags = {TQ3XDrawContextValidationMasks}$00000000;
  310.     kQ3XDrawContextValidationDoubleBuffer = {TQ3XDrawContextValidationMasks}$01;
  311.     kQ3XDrawContextValidationShader = {TQ3XDrawContextValidationMasks}$02;
  312.     kQ3XDrawContextValidationClearFunction = {TQ3XDrawContextValidationMasks}$04;
  313.     kQ3XDrawContextValidationActiveBuffer = {TQ3XDrawContextValidationMasks}$08;
  314.     kQ3XDrawContextValidationInternalOffScreen = {TQ3XDrawContextValidationMasks}$10;
  315.     kQ3XDrawContextValidationPane = {TQ3XDrawContextValidationMasks}$20;
  316.     kQ3XDrawContextValidationMask = {TQ3XDrawContextValidationMasks}$40;
  317.     kQ3XDrawContextValidationDevice = {TQ3XDrawContextValidationMasks}$80;
  318.     kQ3XDrawContextValidationWindow = {TQ3XDrawContextValidationMasks}$0100;
  319.     kQ3XDrawContextValidationWindowSize = {TQ3XDrawContextValidationMasks}$0200;
  320.     kQ3XDrawContextValidationWindowClip = {TQ3XDrawContextValidationMasks}$0400;
  321.     kQ3XDrawContextValidationWindowPosition = {TQ3XDrawContextValidationMasks}$0800;
  322.     kQ3XDrawContextValidationPlatformAttributes = {TQ3XDrawContextValidationMasks}$1000;
  323.     kQ3XDrawContextValidationForegroundShader = {TQ3XDrawContextValidationMasks}$2000;
  324.     kQ3XDrawContextValidationBackgroundShader = {TQ3XDrawContextValidationMasks}$4000;
  325.     kQ3XDrawContextValidationColorPalette = {TQ3XDrawContextValidationMasks}$8000;
  326.     kQ3XDrawContextValidationAll = {TQ3XDrawContextValidationMasks}$FFFFFFFF;
  327.  
  328.  
  329. TYPE
  330.     TQ3XDrawContextValidation            = UInt32;
  331. FUNCTION Q3XDrawContext_ClearValidationFlags(drawContext: TQ3DrawContextObject): TQ3Status; C;
  332. FUNCTION Q3XDrawContext_GetValidationFlags(drawContext: TQ3DrawContextObject; VAR validationFlags: TQ3XDrawContextValidation): TQ3Status; C;
  333.  
  334. {*****************************************************************************
  335.  **                                                                             **
  336.  **                            Renderer Draw Region Tools                         **
  337.  **                                                                             **
  338.  ****************************************************************************}
  339.  
  340. TYPE
  341.     TQ3XDevicePixelType         = LONGINT;
  342. CONST
  343.                                                                 {  These do not indicate byte ordering    }
  344.     kQ3XDevicePixelTypeInvalid    = {TQ3XDevicePixelType}0;        {  Unknown, un-initialized type      }
  345.     kQ3XDevicePixelTypeRGB32    = {TQ3XDevicePixelType}1;        {  Alpha:8 (ignored), R:8, G:8, B:8  }
  346.     kQ3XDevicePixelTypeARGB32    = {TQ3XDevicePixelType}2;        {  Alpha:8, R:8, G:8, B:8               }
  347.     kQ3XDevicePixelTypeRGB24    = {TQ3XDevicePixelType}3;        {  24 bits/pixel, R:8, G:8, B:8      }
  348.     kQ3XDevicePixelTypeRGB16    = {TQ3XDevicePixelType}4;        {  Alpha:1 (ignored), R:5, G:5, B:5  }
  349.     kQ3XDevicePixelTypeARGB16    = {TQ3XDevicePixelType}5;        {  Alpha:1, R:5, G:5, B:5               }
  350.     kQ3XDevicePixelTypeRGB16_565 = {TQ3XDevicePixelType}6;        {  16 bits/pixel, R:5, G:6, B:5      }
  351.     kQ3XDevicePixelTypeIndexed8    = {TQ3XDevicePixelType}7;        {  8-bit color table index              }
  352.     kQ3XDevicePixelTypeIndexed4    = {TQ3XDevicePixelType}8;        {  4-bit color table index              }
  353.     kQ3XDevicePixelTypeIndexed2    = {TQ3XDevicePixelType}9;        {  2-bit color table index              }
  354.     kQ3XDevicePixelTypeIndexed1    = {TQ3XDevicePixelType}10;        {  1-bit color table index              }
  355.  
  356.  
  357. TYPE
  358.     TQ3XClipMaskState             = LONGINT;
  359. CONST
  360.     kQ3XClipMaskFullyExposed    = {TQ3XClipMaskState}0;
  361.     kQ3XClipMaskPartiallyExposed = {TQ3XClipMaskState}1;
  362.     kQ3XClipMaskNotExposed        = {TQ3XClipMaskState}2;
  363.  
  364.  
  365. TYPE
  366.     TQ3XColorDescriptorPtr = ^TQ3XColorDescriptor;
  367.     TQ3XColorDescriptor = RECORD
  368.         redShift:                UInt32;
  369.         redMask:                UInt32;
  370.         greenShift:                UInt32;
  371.         greenMask:                UInt32;
  372.         blueShift:                UInt32;
  373.         blueMask:                UInt32;
  374.         alphaShift:                UInt32;
  375.         alphaMask:                UInt32;
  376.     END;
  377.  
  378.     TQ3XDrawRegionDescriptorPtr = ^TQ3XDrawRegionDescriptor;
  379.     TQ3XDrawRegionDescriptor = RECORD
  380.         width:                    UInt32;
  381.         height:                    UInt32;
  382.         rowBytes:                UInt32;
  383.         pixelSize:                UInt32;
  384.         pixelType:                TQ3XDevicePixelType;
  385.         colorDescriptor:        TQ3XColorDescriptor;
  386.         bitOrder:                TQ3Endian;
  387.         byteOrder:                TQ3Endian;
  388.         clipMask:                TQ3BitmapPtr;
  389.     END;
  390.  
  391.     TQ3XDrawRegionServicesMasks  = LONGINT;
  392. CONST
  393.     kQ3XDrawRegionServicesNoneFlag = {TQ3XDrawRegionServicesMasks}0;
  394.     kQ3XDrawRegionServicesClearFlag = {TQ3XDrawRegionServicesMasks}$01;
  395.     kQ3XDrawRegionServicesDontLockDDSurfaceFlag = {TQ3XDrawRegionServicesMasks}$02;
  396.  
  397.  
  398. TYPE
  399.     TQ3XDrawRegionServices                = UInt32;
  400. {$IFC TYPED_FUNCTION_POINTERS}
  401.     TQ3XDrawRegionRendererPrivateDeleteMethod = PROCEDURE(rendererPrivate: UNIV Ptr); C;
  402. {$ELSEC}
  403.     TQ3XDrawRegionRendererPrivateDeleteMethod = ProcPtr;
  404. {$ENDC}
  405.  
  406. FUNCTION Q3XDrawRegion_GetDeviceScaleX(drawRegion: TQ3XDrawRegion; VAR deviceScaleX: Single): TQ3Status; C;
  407. FUNCTION Q3XDrawRegion_GetDeviceScaleY(drawRegion: TQ3XDrawRegion; VAR deviceScaleY: Single): TQ3Status; C;
  408.  
  409. FUNCTION Q3XDrawRegion_GetDeviceOffsetX(drawRegion: TQ3XDrawRegion; VAR deviceOffsetX: Single): TQ3Status; C;
  410. FUNCTION Q3XDrawRegion_GetDeviceOffsetY(drawRegion: TQ3XDrawRegion; VAR deviceOffsetX: Single): TQ3Status; C;
  411.  
  412. FUNCTION Q3XDrawRegion_GetWindowScaleX(drawRegion: TQ3XDrawRegion; VAR windowScaleX: Single): TQ3Status; C;
  413. FUNCTION Q3XDrawRegion_GetWindowScaleY(drawRegion: TQ3XDrawRegion; VAR windowScaleY: Single): TQ3Status; C;
  414.  
  415. FUNCTION Q3XDrawRegion_GetWindowOffsetX(drawRegion: TQ3XDrawRegion; VAR windowOffsetX: Single): TQ3Status; C;
  416. FUNCTION Q3XDrawRegion_GetWindowOffsetY(drawRegion: TQ3XDrawRegion; VAR windowOffsetY: Single): TQ3Status; C;
  417. FUNCTION Q3XDrawRegion_IsActive(drawRegion: TQ3XDrawRegion; VAR isActive: TQ3Boolean): TQ3Status; C;
  418.  
  419. FUNCTION Q3XDrawRegion_GetNextRegion(drawRegion: TQ3XDrawRegion; VAR nextDrawRegion: TQ3XDrawRegion): TQ3Status; C;
  420.  *  One of the next two functions must be called before using a draw region 
  421.  }
  422. {
  423.  *    Use this Start function if double buffering/image access services from the
  424.  *    Draw Context are not needed, you may still request clear for example
  425.  }
  426. FUNCTION Q3XDrawRegion_Start(drawRegion: TQ3XDrawRegion; services: TQ3XDrawRegionServices; VAR descriptor: TQ3XDrawRegionDescriptorPtr): TQ3Status; C;
  427. {
  428.  *    Use this Start function if double buffering or image access services from 
  429.  *  the Draw Context are needed.
  430.  }
  431. FUNCTION Q3XDrawRegion_StartAccessToImageBuffer(drawRegion: TQ3XDrawRegion; services: TQ3XDrawRegionServices; VAR descriptor: TQ3XDrawRegionDescriptorPtr; VAR image: UNIV Ptr): TQ3Status; C;
  432. {
  433.  *    This function is used to indicate that access to a DrawRegion is ended.
  434.  }
  435. FUNCTION Q3XDrawRegion_End(drawRegion: TQ3XDrawRegion): TQ3Status; C;
  436. FUNCTION Q3XDrawRegion_GetDeviceTransform(drawRegion: TQ3XDrawRegion; VAR deviceTransform: TQ3Matrix4x4Ptr): TQ3Status; C;
  437. FUNCTION Q3XDrawRegion_GetClipFlags(drawRegion: TQ3XDrawRegion; VAR clipMaskState: TQ3XClipMaskState): TQ3Status; C;
  438. FUNCTION Q3XDrawRegion_GetClipMask(drawRegion: TQ3XDrawRegion; VAR clipMask: TQ3BitmapPtr): TQ3Status; C;
  439. {$IFC TARGET_OS_MAC }
  440. FUNCTION Q3XDrawRegion_GetClipRegion(drawRegion: TQ3XDrawRegion; VAR rgnHandle: RgnHandle): TQ3Status; C;
  441. FUNCTION Q3XDrawRegion_GetGDHandle(drawRegion: TQ3XDrawRegion; VAR gdHandle: GDHandle): TQ3Status; C;
  442. {$ENDC}  {TARGET_OS_MAC}
  443.  
  444. FUNCTION Q3XDrawRegion_GetRendererPrivate(drawRegion: TQ3XDrawRegion; VAR rendererPrivate: UNIV Ptr): TQ3Status; C;
  445. FUNCTION Q3XDrawRegion_SetRendererPrivate(drawRegion: TQ3XDrawRegion; rendererPrivate: UNIV Ptr; deleteMethod: TQ3XDrawRegionRendererPrivateDeleteMethod): TQ3Status; C;
  446. FUNCTION Q3XDrawRegion_SetUseDefaultRendererFlag(drawRegion: TQ3XDrawRegion; flag: TQ3Boolean): TQ3Status; C;
  447. FUNCTION Q3XDrawRegion_GetUseDefaultRendererFlag(drawRegion: TQ3XDrawRegion; VAR useDefaultRenderingFlag: TQ3Boolean): TQ3Status; C;
  448.  
  449.  
  450. {*****************************************************************************
  451.  **                                                                             **
  452.  **                            Renderer Class Methods                             **
  453.  **                                                                             **
  454.  ****************************************************************************}
  455. {
  456.  *    Methods from Object
  457.  *        kQ3XMethodTypeObjectClassRegister
  458.  *        kQ3XMethodTypeObjectClassUnregister
  459.  *        kQ3XMethodTypeObjectNew
  460.  *        kQ3XMethodTypeObjectDelete
  461.  *        kQ3XMethodTypeObjectRead
  462.  *        kQ3XMethodTypeObjectTraverse
  463.  *        kQ3XMethodTypeObjectWrite
  464.  *        
  465.  *    Methods from Shared
  466.  *        kQ3MethodTypeSharedEdited
  467.  *
  468.  *    Renderer Methods
  469.  *    
  470.  *    The renderer methods should be implemented according to the type
  471.  *    of renderer being written.
  472.  *
  473.  *    For the purposes of documentation, there are two basic types of
  474.  *    renderers: 
  475.  *
  476.  *        Interactive
  477.  *            Interactive Renderer
  478.  *            WireFrame Renderer
  479.  *        
  480.  *        Deferred
  481.  *            a ray-tracer
  482.  *            painter's algorithm renderer (cached in a BSP triangle tree)
  483.  *            an artistic renderer (simulates a pencil drawing, etc.)
  484.  *
  485.  *    The main difference is how each renderer handles incoming state and 
  486.  *    geometry.
  487.  *
  488.  *    An interactive renderer immediately transforms, culls, and shades
  489.  *    incoming geometry and performs rasterization. For example, in a 
  490.  *    single-buffered WireFrame renderer, you will see a new triangle
  491.  *    immediately after Q3Triangle_Draw (if it's visible, of course).
  492.  *
  493.  *    A deferred renderer caches the view state and each geometry, 
  494.  *    converting into any internal queue of drawing commands. Rasterization
  495.  *    is not actually performed until all data has been submitted.
  496.  *    
  497.  *    For example, a ray-tracer may not rasterize anything until the
  498.  *    end of the rendering loop, or until an EndFrame call is made.
  499.  }
  500.  
  501. {*****************************************************************************
  502.  **                                                                             **
  503.  **                        Renderer User Interface Methods                         **
  504.  **                                                                             **
  505.  ****************************************************************************}
  506. {
  507.  *    kQ3XMethodTypeRendererIsInteractive
  508.  *    
  509.  *    There is no actual method with this - the metahandler simply returns
  510.  *  "(TQ3XFunctionPointer)kQ3True" for this "method" if the renderer is 
  511.  *  intended to be used in interactive settings, and   
  512.  *    "(TQ3XFunctionPointer)kQ3False" otherwise. 
  513.  *  
  514.  *  If neither value is specified in the metahandler, the renderer 
  515.  *  is *assumed to be non-interactive*!!!
  516.  *    
  517.  *    OPTIONAL
  518.  }
  519.  
  520. CONST
  521.     kQ3XMethodTypeRendererIsInteractive = 'isin';
  522.  
  523.  
  524. {
  525.  *    TQ3XRendererModalConfigureMethod
  526.  *    
  527.  *    This method should pop up a modal dialog to edit the renderer settings 
  528.  *    found in the renderer private. 
  529.  *    
  530.  *    dialogAnchor - is platform specific data passed by the client to support
  531.  *      movable modal dialogs. 
  532.  *    MacOS: this is a callback to the calling application's event handler.
  533.  *      The renderer calls this function with events not handled by the 
  534.  *      settings dialog. This is necessary in order to support movable modal 
  535.  *      dialogs. An application's event handler must return kQ3True if it 
  536.  *      handles the event passed to the callback or kQ3False if not. 
  537.  *      An application which doesn't want to support a movable modal configure
  538.  *      dialog should pass NULL for the clientEventHandler of TQ3DialogAnchor.
  539.  *      A renderer should implement a non-movable style dialog in that case.
  540.  *    Win32: this is the HWND of the owning window (typically an application's
  541.  *      main window).  (Win32 application modal dialogs are always movable.)
  542.  *  canceled - returns a boolean inditacating that the user canceled the 
  543.  *    dialog.
  544.  *    
  545.  *    OPTIONAL
  546.  }
  547.     kQ3XMethodTypeRendererModalConfigure = 'rdmc';
  548.  
  549.  
  550. TYPE
  551. {$IFC TYPED_FUNCTION_POINTERS}
  552.     TQ3XRendererModalConfigureMethod = FUNCTION(renderer: TQ3RendererObject; dialogAnchor: TQ3DialogAnchor; VAR canceled: TQ3Boolean; rendererPrivate: UNIV Ptr): TQ3Status; C;
  553. {$ELSEC}
  554.     TQ3XRendererModalConfigureMethod = ProcPtr;
  555. {$ENDC}
  556.  
  557. {
  558.  *    kQ3XMethodTypeRendererGetNickNameString
  559.  *    
  560.  *        Allows an application to collect the name of the renderer for
  561.  *        display in a user interface item such as a menu.
  562.  *    
  563.  *        If dataBuffer is NULL actualDataSize returns the required size in 
  564.  *        bytes of a data buffer large enough to store the renderer name. 
  565.  *
  566.  *      bufferSize is the actual size of the memory block pointed to by 
  567.  *        dataBuffer
  568.  *
  569.  *        actualDataSize - on return the actual number of bytes written to the
  570.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  571.  *
  572.  *    OPTIONAL
  573.  }
  574.  
  575. CONST
  576.     kQ3XMethodTypeRendererGetNickNameString = 'rdns';
  577.  
  578.  
  579. TYPE
  580. {$IFC TYPED_FUNCTION_POINTERS}
  581.     TQ3XRendererGetNickNameStringMethod = FUNCTION(VAR dataBuffer: UInt8; bufferSize: UInt32; VAR actualDataSize: UInt32): TQ3Status; C;
  582. {$ELSEC}
  583.     TQ3XRendererGetNickNameStringMethod = ProcPtr;
  584. {$ENDC}
  585.  
  586. {
  587.  *    kQ3XMethodTypeRendererGetConfigurationData
  588.  *    
  589.  *        Allows an application to collect private configuration data from the
  590.  *      renderer which it will then save. For example in a preference file, 
  591.  *      a registry key (on Windows) or in a style template. An application 
  592.  *      should tag this data with the renderer's object name.
  593.  *    
  594.  *        If dataBuffer is NULL actualDataSize returns the required size in 
  595.  *        bytes of a data buffer large enough to store private data. 
  596.  *
  597.  *      bufferSize is the actual size of the memory block pointed to by 
  598.  *        dataBuffer
  599.  *
  600.  *        actualDataSize - on return the actual number of bytes written to the
  601.  *        buffer or if dataBuffer is NULL the required size of dataBuffer
  602.  *
  603.  *    OPTIONAL
  604.  }
  605.  
  606. CONST
  607.     kQ3XMethodTypeRendererGetConfigurationData = 'rdgp';
  608.  
  609.  
  610. TYPE
  611. {$IFC TYPED_FUNCTION_POINTERS}
  612.     TQ3XRendererGetConfigurationDataMethod = FUNCTION(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32; VAR actualDataSize: UInt32; rendererPrivate: UNIV Ptr): TQ3Status; C;
  613. {$ELSEC}
  614.     TQ3XRendererGetConfigurationDataMethod = ProcPtr;
  615. {$ENDC}
  616.  
  617. {
  618.  *    TQ3XRendererSetConfigurationDataMethod
  619.  *    
  620.  *        Allows an application to pass private configuration data which has
  621.  *         previously  been obtained from a renderer via 
  622.  *        Q3Renderer_GetConfigurationData. For example in a preference file or 
  623.  *        in a style template. An application should tag this data with the 
  624.  *        renderer's object name.
  625.  *    
  626.  *      bufferSize is the actual size of the memory block pointed to by 
  627.  *        dataBuffer
  628.  *
  629.  *    OPTIONAL
  630.  }
  631.  
  632. CONST
  633.     kQ3XMethodTypeRendererSetConfigurationData = 'rdsp';
  634.  
  635.  
  636. TYPE
  637. {$IFC TYPED_FUNCTION_POINTERS}
  638.     TQ3XRendererSetConfigurationDataMethod = FUNCTION(renderer: TQ3RendererObject; VAR dataBuffer: UInt8; bufferSize: UInt32; rendererPrivate: UNIV Ptr): TQ3Status; C;
  639. {$ELSEC}
  640.     TQ3XRendererSetConfigurationDataMethod = ProcPtr;
  641. {$ENDC}
  642.  
  643. {*****************************************************************************
  644.  **                                                                             **
  645.  **                        Renderer Drawing State Methods                         **
  646.  **                                                                             **
  647.  ****************************************************************************}
  648. {
  649.  *    TQ3RendererStartFrame
  650.  *    
  651.  *    The StartFrame method is called first at Q3View_StartRendering
  652.  *    and should:
  653.  *        - initialize any renderer state to defaults
  654.  *        - extract any and all useful data from the drawContext
  655.  *
  656.  *    If your renderer passed in kQ3RendererFlagClearBuffer at 
  657.  *    registration, then it should also:
  658.  *        - clear the drawContext 
  659.  *    
  660.  *        When clearing, your renderer may opt to:
  661.  *        - NOT clear anything (if you touch every pixel, for example)
  662.  *        - to clear with your own routine, or
  663.  *        - to use the draw context default clear method by calling 
  664.  *        Q3DrawContext_Clear. Q3DrawContext_Clear takes advantage of
  665.  *        any available hardware in the system for clearing.
  666.  *    
  667.  *    This call also signals the start of all default submit commands from
  668.  *    the view. The renderer will receive updates for the default view
  669.  *    state via its Update methods before StartPass is called.
  670.  *    
  671.  *    REQUIRED
  672.  }
  673.  
  674. CONST
  675.     kQ3XMethodTypeRendererStartFrame = 'rdcl';
  676.  
  677.  
  678. TYPE
  679. {$IFC TYPED_FUNCTION_POINTERS}
  680.     TQ3XRendererStartFrameMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C;
  681. {$ELSEC}
  682.     TQ3XRendererStartFrameMethod = ProcPtr;
  683. {$ENDC}
  684.  
  685. {
  686.  *    kQ3XMethodTypeRendererStartPass
  687.  *    TQ3XRendererStartPassMethod
  688.  *    
  689.  *    The StartPass method is called during Q3View_StartRendering but after
  690.  *    the StartFrame command. It should:
  691.  *        - collect camera and light information
  692.  *    
  693.  *    If your renderer supports deferred camera transformation, camera is the
  694.  *    main camera which will be submitted in the hierarchy somewhere. It
  695.  *    is never NULL.
  696.  *
  697.  *    If your renderer does not support deferred camera transformation, camera
  698.  *    is the transformed camera.
  699.  *
  700.  *    If your renderer supports deferred light transformation, lights will be
  701.  *    NULL, and will be submitted to your light draw methods instead.
  702.  *
  703.  *    This call signals the end of the default update state, and the start of 
  704.  *  submit commands from the user to the view.
  705.  *
  706.  *    REQUIRED
  707.  }
  708.  
  709. CONST
  710.     kQ3XMethodTypeRendererStartPass = 'rdst';
  711.  
  712.  
  713. TYPE
  714. {$IFC TYPED_FUNCTION_POINTERS}
  715.     TQ3XRendererStartPassMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; camera: TQ3CameraObject; lightGroup: TQ3GroupObject): TQ3Status; C;
  716. {$ELSEC}
  717.     TQ3XRendererStartPassMethod = ProcPtr;
  718. {$ENDC}
  719.  
  720. {
  721.  *    kQ3XMethodTypeRendererFlushFrame
  722.  *    TQ3XRendererFlushFrameMethod
  723.  *    
  724.  *    This call is only implemented by asynchronous renderers.
  725.  *    
  726.  *    The FlushFrame method is called between the StartPass and EndPass
  727.  *    methods and is called when the user wishes to flush any asynchronous
  728.  *    drawing tasks (which draw to the drawcontext), but does not want 
  729.  *    to block.
  730.  *    
  731.  *    The result of this call is that an image should "eventually" appear
  732.  *    asynchronously.
  733.  *    
  734.  *    For asynchronous rendering, this call is non-blocking.
  735.  *    
  736.  *    An interactive renderer should ensure that all received
  737.  *    geometries are drawn in the image.
  738.  *    
  739.  *    An interactive renderer that talks to hardware should force
  740.  *    the hardware to generate an image.
  741.  *    
  742.  *    A deferred renderer should exhibit a similar behaviour,
  743.  *    though it is not required.  A deferred renderer should spawn
  744.  *    a process that generates a partial image from the currently
  745.  *    accumulated drawing state. 
  746.  *    
  747.  *    However, for renderers such as ray-tracers which generally are
  748.  *    quite compute-intensive, FlushFrame is not required and is a no-op.
  749.  *
  750.  *    OPTIONAL
  751.  }
  752.  
  753. CONST
  754.     kQ3XMethodTypeRendererFlushFrame = 'rdfl';
  755.  
  756.  
  757. TYPE
  758. {$IFC TYPED_FUNCTION_POINTERS}
  759.     TQ3XRendererFlushFrameMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C;
  760. {$ELSEC}
  761.     TQ3XRendererFlushFrameMethod = ProcPtr;
  762. {$ENDC}
  763.  
  764. {
  765.  *    kQ3XMethodTypeRendererEndPass
  766.  *    TQ3XRendererEndPassMethod
  767.  *    
  768.  *    The EndPass method is called at Q3View_EndRendering and signals
  769.  *    the end of submit commands to the view.
  770.  *
  771.  *    If an error occurs, the renderer should call Q3XError_Post and
  772.  *    return kQ3ViewStatusError.
  773.  *    
  774.  *    If a renderer requires another pass on the renderering data,
  775.  *    it should return kQ3ViewStatusRetraverse.
  776.  *    
  777.  *    If rendering was cancelled, this function will not be called
  778.  *    and the view will handle returning kQ3ViewStatusCancelled;
  779.  *    
  780.  *    Otherwise, your renderer should begin completing the process of 
  781.  *    generating the image in the drawcontext. If you have buffered
  782.  *    any drawing data, flush it. RendererEnd should have a similar
  783.  *    effect as RendererFlushFrame.
  784.  *    
  785.  *    If the renderer is synchronous:
  786.  *        - complete rendering of the entire frame
  787.  *        if the renderer supports kQ3RendererClassSupportDoubleBuffer
  788.  *            - Update the front buffer
  789.  *        else
  790.  *            - DrawContext will update the front buffer after returning
  791.  *
  792.  *    If the renderer is asynchronous
  793.  *        - spawn rendering thread for entire frame
  794.  *        if the renderer supports kQ3RendererClassSupportDoubleBuffer,
  795.  *            - you must eventually update the front buffer asynchronously
  796.  *        else
  797.  *            - you must eventually update the back buffer asynchronously
  798.  *            
  799.  *    REQUIRED
  800.  }
  801.  
  802. CONST
  803.     kQ3XMethodTypeRendererEndPass = 'rded';
  804.  
  805.  
  806. TYPE
  807. {$IFC TYPED_FUNCTION_POINTERS}
  808.     TQ3XRendererEndPassMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3ViewStatus; C;
  809. {$ELSEC}
  810.     TQ3XRendererEndPassMethod = ProcPtr;
  811. {$ENDC}
  812.  
  813. {
  814.  *    kQ3XMethodTypeRendererEndFrame
  815.  *    TQ3XRendererEndFrame
  816.  *    
  817.  *    This call is only implemented by asynchronous renderers.
  818.  *
  819.  *    The EndFrame method is called from Q3View_Sync, which is
  820.  *    called after Q3View_EndRendering and signals that the user
  821.  *    wishes to see the completed image and is willing to block.
  822.  *    
  823.  *    If your renderer supports kQ3RendererFlagDoubleBuffer
  824.  *        - update the front buffer completely 
  825.  *    else
  826.  *        - update the back buffer completely
  827.  *
  828.  *    This call is equivalent in functionality to RendererFlushFrame
  829.  *    but blocks until the image is completed.
  830.  *    
  831.  *    If no method is supplied, the default is a no-op.
  832.  *    
  833.  *    NOTE: Registering a method of this type indicates that your renderer will
  834.  *    be rendering after Q3View_EndRendering has been called.
  835.  *    
  836.  *    OPTIONAL
  837.  }
  838.  
  839. CONST
  840.     kQ3XMethodTypeRendererEndFrame = 'rdsy';
  841.  
  842.  
  843. TYPE
  844. {$IFC TYPED_FUNCTION_POINTERS}
  845.     TQ3XRendererEndFrameMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; drawContext: TQ3DrawContextObject): TQ3Status; C;
  846. {$ELSEC}
  847.     TQ3XRendererEndFrameMethod = ProcPtr;
  848. {$ENDC}
  849.  
  850. {
  851.  *    The RendererCancel method is called after Q3View_StartRendering
  852.  *    and signals the termination of all rendering operations.
  853.  *
  854.  *    A renderer should clean up any cached data, and cancel all 
  855.  *    rendering operations.
  856.  *    
  857.  *    If called before Q3View_EndRendering, the RendererEnd method
  858.  *    is NOT called.
  859.  *    
  860.  *    If called after Q3View_EndRendering, the renderer should kill
  861.  *    any threads and terminate any further rendering.
  862.  *    
  863.  *    REQUIRED
  864.  }
  865.  
  866. CONST
  867.     kQ3XMethodTypeRendererCancel = 'rdab';
  868.  
  869.  
  870. TYPE
  871. {$IFC TYPED_FUNCTION_POINTERS}
  872.     TQ3XRendererCancelMethod = PROCEDURE(view: TQ3ViewObject; rendererPrivate: UNIV Ptr); C;
  873. {$ELSEC}
  874.     TQ3XRendererCancelMethod = ProcPtr;
  875. {$ENDC}
  876.  
  877. {*****************************************************************************
  878.  **                                                                             **
  879.  **                        Renderer DrawContext Methods                         **
  880.  **                                                                             **
  881.  ****************************************************************************}
  882. {
  883.  *    kQ3XMethodTypeRendererPush
  884.  *    TQ3XRendererPushMethod
  885.  *    
  886.  *    kQ3XMethodTypeRendererPop
  887.  *    TQ3XRendererPopMethod
  888.  *    
  889.  *    These methods are called whenever the graphics state in the view
  890.  *    is pushed or popped. The user may isolate state by calling:
  891.  *    
  892.  *    Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &red, view);
  893.  *    Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &blue, view);
  894.  *    Q3Attribute_Submit(kQ3AttributeTypeSpecularColor, &white, view);
  895.  *    Q3Box_Submit(&unitBox, view);
  896.  *    Q3TranslateTransform_Submit(&unitVector, view);
  897.  *    Q3Push_Submit(view);
  898.  *        Q3Attribute_Submit(kQ3AttributeTypeDiffuseColor, &blue, view);
  899.  *        Q3Attribute_Submit(kQ3AttributeTypeTransparencyColor, &green, view);
  900.  *        Q3Box_Submit(&unitBox, view);
  901.  *    Q3Pop_Submit(view);    
  902.  *    Q3TranslateTransform_Submit(&unitVector, view);
  903.  *    Q3Box_Submit(&unitBox, view);
  904.  *    
  905.  *    or by submitting a display group which pushes and pops.
  906.  *    
  907.  *    If you support RendererPush and RendererPop in your renderer:
  908.  *        - you must maintain your drawing state as a stack, as well.
  909.  *        - you will not be updated with the popped state after
  910.  *            RendererPop is called.
  911.  *
  912.  *    If you do not support Push and Pop in your renderer:
  913.  *        - you may maintain a single copy of the drawing state.
  914.  *        - you will be updated with changed fields after the view stack is
  915.  *            popped.
  916.  *
  917.  *    A renderer that supports Push and Pop gets called in the following
  918.  *    sequence (from example above):
  919.  *    
  920.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  921.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  922.  *    RendererUpdateAttributeSpecularColor(&white,...)
  923.  *    RendererUpdateMatrixLocalToWorld(...)
  924.  *    RendererSubmitGeometryBox(...)
  925.  *    RendererPush(...)
  926.  *        RendererUpdateAttributeDiffuseColor(&blue,...)
  927.  *        RendererUpdateAttributeTransparencyColor(&green,...)
  928.  *        RendererSubmitGeometryBox(...)
  929.  *    RendererPop(...)
  930.  *    RendererUpdateMatrixLocalToWorld(...)
  931.  *    RendererSubmitGeometryBox(...)
  932.  *
  933.  *    A renderer that does not supports Push and Pop gets called in the
  934.  *    following sequence:
  935.  *    
  936.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  937.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  938.  *    RendererUpdateAttributeSpecularColor(&white,...)
  939.  *    RendererUpdateMatrixLocalToWorld(...)
  940.  *    RendererSubmitGeometryBox(...)
  941.  *        RendererUpdateAttributeDiffuseColor(&blue,...)
  942.  *        RendererUpdateAttributeTransparencyColor(&green,...)
  943.  *        RendererSubmitGeometryBox(...)
  944.  *    RendererUpdateAttributeDiffuseColor(&red,...)
  945.  *    RendererUpdateAttributeTransparencyColor(&blue,...)
  946.  *    RendererUpdateMatrixLocalToWorld(...)
  947.  *    RendererSubmitGeometryBox(...)
  948.  *    
  949.  }
  950.  
  951. CONST
  952.     kQ3XMethodTypeRendererPush    = 'rdps';
  953.  
  954.  
  955. TYPE
  956. {$IFC TYPED_FUNCTION_POINTERS}
  957.     TQ3XRendererPushMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3Status; C;
  958. {$ELSEC}
  959.     TQ3XRendererPushMethod = ProcPtr;
  960. {$ENDC}
  961.  
  962.  
  963. CONST
  964.     kQ3XMethodTypeRendererPop    = 'rdpo';
  965.  
  966.  
  967. TYPE
  968. {$IFC TYPED_FUNCTION_POINTERS}
  969.     TQ3XRendererPopMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr): TQ3Status; C;
  970. {$ELSEC}
  971.     TQ3XRendererPopMethod = ProcPtr;
  972. {$ENDC}
  973.  
  974. {*****************************************************************************
  975.  **                                                                             **
  976.  **                            Renderer Cull Methods                             **
  977.  **                                                                             **
  978.  ****************************************************************************}
  979. {
  980.  *    kQ3XMethodTypeRendererIsBoundingBoxVisible
  981.  *    TQ3XRendererIsBoundingBoxVisibleMethod
  982.  *    
  983.  *    This method is called to cull complex groups and geometries 
  984.  *    given their bounding box in local space.
  985.  *    
  986.  *    It should transform the local-space bounding box coordinates to
  987.  *    frustum space and return a TQ3Boolean return value indicating
  988.  *    whether the box appears within the viewing frustum.
  989.  *    
  990.  *    If no method is supplied, the default behavior is to return
  991.  *    kQ3True.
  992.  *    
  993.  }
  994.  
  995. CONST
  996.     kQ3XMethodTypeRendererIsBoundingBoxVisible = 'rdbx';
  997.  
  998.  
  999. TYPE
  1000. {$IFC TYPED_FUNCTION_POINTERS}
  1001.     TQ3XRendererIsBoundingBoxVisibleMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; {CONST}VAR bBox: TQ3BoundingBox): TQ3Boolean; C;
  1002. {$ELSEC}
  1003.     TQ3XRendererIsBoundingBoxVisibleMethod = ProcPtr;
  1004. {$ENDC}
  1005.  
  1006.  
  1007. {*****************************************************************************
  1008.  **                                                                             **
  1009.  **                        Renderer Object Support Methods                         **
  1010.  **                                                                             **
  1011.  ****************************************************************************}
  1012. {
  1013.  *    Drawing methods (Geometry, Camera, Lights)
  1014.  *
  1015.  }
  1016. {
  1017.  *    Geometry MetaHandler
  1018.  *    
  1019.  *    This metaHandler is required to support 
  1020.  *    
  1021.  *    kQ3GeometryTypeTriangle
  1022.  *    kQ3GeometryTypeLine
  1023.  *    kQ3GeometryTypePoint
  1024.  *    kQ3GeometryTypeMarker
  1025.  *    kQ3GeometryTypePixmapMarker
  1026.  *    
  1027.  *    REQUIRED
  1028.  }
  1029.  
  1030. CONST
  1031.     kQ3XMethodTypeRendererSubmitGeometryMetaHandler = 'rdgm';
  1032.  
  1033.  
  1034. TYPE
  1035. {$IFC TYPED_FUNCTION_POINTERS}
  1036.     TQ3XRendererSubmitGeometryMetaHandlerMethod = FUNCTION(geometryType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1037. {$ELSEC}
  1038.     TQ3XRendererSubmitGeometryMetaHandlerMethod = ProcPtr;
  1039. {$ENDC}
  1040.  
  1041. {
  1042.  *    The TQ3XRendererSubmitGeometryMetaHandlerMethod switches on geometryType
  1043.  *    of kQ3GeometryTypeFoo and returns methods of type:
  1044.  }
  1045. {$IFC TYPED_FUNCTION_POINTERS}
  1046.     TQ3XRendererSubmitGeometryMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; geometry: TQ3GeometryObject; publicData: UNIV Ptr): TQ3Status; C;
  1047. {$ELSEC}
  1048.     TQ3XRendererSubmitGeometryMethod = ProcPtr;
  1049. {$ENDC}
  1050.  
  1051. {
  1052.  *    Camera MetaHandler
  1053.  *    
  1054.  *    This metaHandler, if supplied, indicates that your renderer
  1055.  *    handles deferred transformation of the main camera within a scene.
  1056.  *    
  1057.  *    If not supplied, or an unsupported camera is used, the view will do
  1058.  *    the transformation for the renderer and pass in a camera in the 
  1059.  *    StartPass method.
  1060.  *    
  1061.  *    OPTIONAL
  1062.  }
  1063.  
  1064. CONST
  1065.     kQ3XMethodTypeRendererSubmitCameraMetaHandler = 'rdcm';
  1066.  
  1067.  
  1068. TYPE
  1069. {$IFC TYPED_FUNCTION_POINTERS}
  1070.     TQ3XRendererSubmitCameraMetaHandlerMethod = FUNCTION(cameraType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1071. {$ELSEC}
  1072.     TQ3XRendererSubmitCameraMetaHandlerMethod = ProcPtr;
  1073. {$ENDC}
  1074.  
  1075. {
  1076.  *    The TQ3XRendererSubmitCameraMetaHandlerMethod switches on cameraType
  1077.  *    of kQ3CameraTypeFoo and returns methods of type:
  1078.  }
  1079. {$IFC TYPED_FUNCTION_POINTERS}
  1080.     TQ3XRendererSubmitCameraMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; camera: TQ3CameraObject; publicData: UNIV Ptr): TQ3Status; C;
  1081. {$ELSEC}
  1082.     TQ3XRendererSubmitCameraMethod = ProcPtr;
  1083. {$ENDC}
  1084.  
  1085. {
  1086.  *    Light MetaHandler
  1087.  *    
  1088.  *    This metaHandler, if supplied, indicates that your renderer
  1089.  *    handles deferred transformation of lights within a scene.
  1090.  *    
  1091.  *    If an unsupported light is encountered, it is ignored.
  1092.  *
  1093.  *    OPTIONAL
  1094.  }
  1095.  
  1096. CONST
  1097.     kQ3XMethodTypeRendererSubmitLightMetaHandler = 'rdlg';
  1098.  
  1099.  
  1100. TYPE
  1101. {$IFC TYPED_FUNCTION_POINTERS}
  1102.     TQ3XRendererSubmitLightMetaHandlerMethod = FUNCTION(lightType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1103. {$ELSEC}
  1104.     TQ3XRendererSubmitLightMetaHandlerMethod = ProcPtr;
  1105. {$ENDC}
  1106.  
  1107. {
  1108.  *    The TQ3XRendererSubmitLightMetaHandlerMethod switches on lightType
  1109.  *    of kQ3LightTypeFoo and returns methods of type:
  1110.  }
  1111. {$IFC TYPED_FUNCTION_POINTERS}
  1112.     TQ3XRendererSubmitLightMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; light: TQ3LightObject; publicData: UNIV Ptr): TQ3Status; C;
  1113. {$ELSEC}
  1114.     TQ3XRendererSubmitLightMethod = ProcPtr;
  1115. {$ENDC}
  1116.  
  1117. {
  1118.  *
  1119.  *    Update methods
  1120.  *
  1121.  *    They are called whenever the state has changed. If the renderer supports
  1122.  *    the RendererPush and RendererPop methods, it must maintain its own state
  1123.  *    stack. Updates are not called for changed data when the view stack is
  1124.  *    popped.
  1125.  *
  1126.  *    See the comments for the RendererPush and RendererPop methods above
  1127.  *    for an example of how data is updated.
  1128.  *
  1129.  }
  1130. {
  1131.  *    Style
  1132.  }
  1133.  
  1134. CONST
  1135.     kQ3XMethodTypeRendererUpdateStyleMetaHandler = 'rdyu';
  1136.  
  1137.  
  1138. TYPE
  1139. {$IFC TYPED_FUNCTION_POINTERS}
  1140.     TQ3XRendererUpdateStyleMetaHandlerMethod = FUNCTION(styleType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1141. {$ELSEC}
  1142.     TQ3XRendererUpdateStyleMetaHandlerMethod = ProcPtr;
  1143. {$ENDC}
  1144.  
  1145. {
  1146.  *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on styleType
  1147.  *    of kQ3StyleTypeFoo and returns methods of type:
  1148.  }
  1149. {$IFC TYPED_FUNCTION_POINTERS}
  1150.     TQ3XRendererUpdateStyleMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; publicData: UNIV Ptr): TQ3Status; C;
  1151. {$ELSEC}
  1152.     TQ3XRendererUpdateStyleMethod = ProcPtr;
  1153. {$ENDC}
  1154.  
  1155. {
  1156.  *    Attributes
  1157.  }
  1158.  
  1159. CONST
  1160.     kQ3XMethodTypeRendererUpdateAttributeMetaHandler = 'rdau';
  1161.  
  1162.  
  1163. TYPE
  1164. {$IFC TYPED_FUNCTION_POINTERS}
  1165.     TQ3XRendererUpdateAttributeMetaHandlerMethod = FUNCTION(attributeType: TQ3AttributeType): TQ3XFunctionPointer; C;
  1166. {$ELSEC}
  1167.     TQ3XRendererUpdateAttributeMetaHandlerMethod = ProcPtr;
  1168. {$ENDC}
  1169.  
  1170. {
  1171.  *    The TQ3XRendererUpdateStyleMetaHandlerMethod switches on attributeType
  1172.  *    of kQ3AttributeTypeFoo and returns methods of type:
  1173.  }
  1174. {$IFC TYPED_FUNCTION_POINTERS}
  1175.     TQ3XRendererUpdateAttributeMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; publicData: UNIV Ptr): TQ3Status; C;
  1176. {$ELSEC}
  1177.     TQ3XRendererUpdateAttributeMethod = ProcPtr;
  1178. {$ENDC}
  1179.  
  1180. {
  1181.  *    Shaders
  1182.  }
  1183.  
  1184. CONST
  1185.     kQ3XMethodTypeRendererUpdateShaderMetaHandler = 'rdsu';
  1186.  
  1187.  
  1188. TYPE
  1189. {$IFC TYPED_FUNCTION_POINTERS}
  1190.     TQ3XRendererUpdateShaderMetaHandlerMethod = FUNCTION(shaderType: TQ3ObjectType): TQ3XFunctionPointer; C;
  1191. {$ELSEC}
  1192.     TQ3XRendererUpdateShaderMetaHandlerMethod = ProcPtr;
  1193. {$ENDC}
  1194.  
  1195. {
  1196.  *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on shaderType
  1197.  *    of kQ3ShaderTypeFoo and returns methods of type:
  1198.  }
  1199. {$IFC TYPED_FUNCTION_POINTERS}
  1200.     TQ3XRendererUpdateShaderMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; shaderObject: TQ3Object): TQ3Status; C;
  1201. {$ELSEC}
  1202.     TQ3XRendererUpdateShaderMethod = ProcPtr;
  1203. {$ENDC}
  1204.  
  1205. {
  1206.  *    Matrices
  1207.  }
  1208.  
  1209. CONST
  1210.     kQ3XMethodTypeRendererUpdateMatrixMetaHandler = 'rdxu';
  1211.  
  1212.  
  1213. TYPE
  1214.     TQ3XRendererUpdateMatrixMetaHandlerMethod = TQ3XMetaHandler;
  1215. {
  1216.  *    The TQ3XRendererUpdateShaderMetaHandlerMethod switches on methods
  1217.  *    of the form kQ3MethodTypeRendererUpdateMatrixFoo:
  1218.  }
  1219.  
  1220. CONST
  1221.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorld = 'ulwx';
  1222.  
  1223.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverse = 'ulwi';
  1224.  
  1225.     kQ3XMethodTypeRendererUpdateMatrixLocalToWorldInverseTranspose = 'ulwt';
  1226.  
  1227.     kQ3XMethodTypeRendererUpdateMatrixLocalToCamera = 'ulcx';
  1228.  
  1229.     kQ3XMethodTypeRendererUpdateMatrixLocalToFrustum = 'ulfx';
  1230.  
  1231.     kQ3XMethodTypeRendererUpdateMatrixWorldToFrustum = 'uwfx';
  1232.  
  1233. {
  1234.  *    and returns methods of type:
  1235.  }
  1236.  
  1237. TYPE
  1238. {$IFC TYPED_FUNCTION_POINTERS}
  1239.     TQ3XRendererUpdateMatrixMethod = FUNCTION(view: TQ3ViewObject; rendererPrivate: UNIV Ptr; {CONST}VAR matrix: TQ3Matrix4x4): TQ3Status; C;
  1240. {$ELSEC}
  1241.     TQ3XRendererUpdateMatrixMethod = ProcPtr;
  1242. {$ENDC}
  1243.  
  1244.  
  1245. {$ALIGN RESET}
  1246. {$POP}
  1247.  
  1248. {$SETC UsingIncludes := QD3DRendererIncludes}
  1249.  
  1250. {$ENDC} {__QD3DRENDERER__}
  1251.  
  1252. {$IFC NOT UsingIncludes}
  1253.  END.
  1254. {$ENDC}
  1255.